home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-06-16 | 1.9 KB | 98 lines | [TEXT/MPS ] |
- ;
- ; SpINIT I N I T
- ;
- ; Patch show window to spin & zoom on ShowWindow
- ;
-
-
- IMPORT SpinFrame
-
-
- PRINT OFF
- INCLUDE 'QuickEqu.a'
- INCLUDE 'ScriptEqu.a'
- INCLUDE 'ToolEqu.a'
- INCLUDE 'SysEqu.a'
- INCLUDE 'Traps.a'
- INCLUDE 'PackMacs.a'
- PRINT ON
-
-
- Pack3trap EQU $1EA ; trap num for Pack 3 ($A9EA)
- ShowWind EQU $115 ; trap num for Pack 3 ($A915)
- PatchSize EQU 3072 ; size of our patch
-
-
-
-
- ;
- ; P a t c h I n s t a l l a t i o n C o d e
- ;
-
- SFPlace FUNC EXPORT
-
- Entry
-
- LEA trapdoor, A0 ; put instr code @ end of patch
- MOVE.W #$4EF9, (A0) ; 68000 code
-
- ; FUNCTION GetTrapAddress (trapNum: integer): longint;
- ; trapNum => D0, result => A0
- MOVE.W #ShowWind,D0 ; trap
- _GetTrapAddress
-
- ; push it into the jmp Instruction
- LEA trapdoor+2,A1 ; put instr code here
- MOVE.L A0,(A1) ; install addr
-
- ; allocate space for patch in the system heap
- ; FUNCTION NewPtr (size: longint): Ptr;
- ; size => D0, Ptr => A0
- MOVE.L #PatchSize,D0 ; patch size
- _NewPtr SYS
- MOVE.L A0,-(SP) ; save ptr on stack
-
- ; copy patch to new block
- ; PROCEDURE BlockMove (src, dest: ptr; size: longint);
- ; src => A0, dest => A1, size => D0
- MOVE.L A0,A1 ; dest of move
- LEA patchStart,A0 ; src of move
- MOVE.L #PatchSize,D0 ; patch size
- _BlockMove
-
- ; Install Ptr to our patch in the dispatch table
- ; PROCEDURE SetTrapAddress (trapAddr: longint; trapNum: integer);
- ; trapAddr => A0, trapNum => D0
- MOVE.W #ShowWind,D0 ; trap
- MOVE.L (SP)+,A0 ; address of new patch
- _SetTrapAddress
-
- RTS
-
-
- ;
- ; E x e c u t a b l e P a t c h C o d e
- ;
- patchStart
- MOVEM.L A0-A1/D0-D2,-(SP) ; save the registers
-
- ; Actual code of this patch
-
- MOVE.L $0018 (A7),-(SP)
- JSR SpinFrame
-
- MOVEM.L (SP)+, A0-A1/D0-D2 ; restore the registers
- trapdoor
- DC.W 0,0,0 ; will become JMP ABS.L
- svSysRef
- DC.W 1
- svDirID
- DC.L 2
- patchEnd
-
-
- ENDFUNC
-
-
- END
-